Socket.prototype.[Symbol.asyncDispose] - Node documentation
method Socket.prototype.[Symbol.asyncDispose]

Usage in Deno

import { Socket } from "node:dgram";
Socket.prototype.[Symbol.asyncDispose](): Promise<void>

Calls socket.close() and returns a promise that fulfills when the socket has closed.

Return Type

Promise<void>